<?php include "../config.php";?>
<?php session_start(); ?>
<!--/*验证码的session开始，如果不放在前面，有的服务器会出现警告*/-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>公有农垦公司集采系统</title>
    <link href="css/index.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" src="js/viewport.js"></script>

</head>


<body>
<?

if(!isset($_REQUEST['username']) or $_REQUEST['username']=='')
{
	$_REQUEST['username']='';
	$_REQUEST['userpass']='';
}
?>

<div id="width_height">



    <div class="gate_content">

            <div id="logo">
                <span>公有</span>

            <h5>公有农垦公司集采系统</h5>
            </div>


        <?if($_REQUEST['notice']=="nosession"){?>
            <div style="color: red"> 登录状态异常，请重新登录。 </div>
            <?;}?>


<div id="content_form">
<form id="loginform" name="loginform" method="post" action="" enctype="multipart/form-data">
<ul>

    <input type="hidden" name="unit" id="unit" value="<? echo $_REQUEST['unit'] ?>"/>
    <?
    $now_unit             = str_replace("/login/", "", $_REQUEST['unit']);
    setcookie("unit", $now_unit , time() + 365 * 24 * 3600,"/");
    ?>



        <li><label class="icon_1"></label>
            <input type="text" name="account" alt="账号" id="account"
                   value="<? echo $_REQUEST['account'] ?>"
                   placeholder="账号"/>
        </li>

        <li><label class="icon_2"></label>
            <input type="password" name="password" id="password" alt=""
                   value="<? echo $_REQUEST['password'] ?>"
                   placeholder="密码"/>
        </li>

    <li>
        <input type="text" name="code" id="code" style="float: left;width: 150px;;" alt="验证码"  />

    <img src="../application/verify/z_imgcode.php" onclick='this.src="../application/verify/z_imgcode.php?"+Math.random();' style="cursor:pointer;height: 50px;width: 150px;">
    </li>
    <?php
    if(isset($_REQUEST['code'])){
        if($_REQUEST['code'] == strtolower($_SESSION['yzm'])){
            echo "
		<script type='text/javascript'>
		document.getElementById('loginform').action = 'logincheck.php';
        document.getElementById('loginform').submit();
		</script>";
        }else{
            echo '<script type="text/javascript"> alert("请输入正确的验证码！");</script>';
        }
    }
    ?>


        <input type="submit" name="submit" id='submit' value="登　陆" />

</ul>




</form>


</div>
    </div>

</div>

</body>
</html>